home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / I-Z / RA.cpt / Loop.ra < prev    next >
Text File  |  1986-10-15  |  740b  |  47 lines

  1. |
  2. |   RA™
  3. |
  4. |    Loops
  5. |
  6. |   © 1986 COM~LINK & S.Koren
  7. |
  8. #M;
  9. "RA™ has one type of looping construct.!"
  10. "Any code imbedded between ()!"
  11. "will loop forever.!!"
  12. "If a ~ is  inserted within the ()!"
  13. "the top number on the stack is!"
  14. "tested, and if true the loop!"
  15. "terminates.!!"
  16. #A;
  17. "A single loop:!"
  18. 10 A: ( A. ! A. 1 - A: A. 0 > ~)
  19. #A;
  20. "Now a nested loop:"
  21. 5 A: ( "!A!" 5 B: ("B" B . 1 - B: B. 0 > ~) A. 1 - A: A. 0 > ~) "!"
  22. #A;
  23. "THE END."
  24. $
  25. &A
  26. "!Hit any key: " ?§ µ @`
  27. |
  28. |  RA title routine
  29. |
  30. &M @ #L; 8 A: ( #N; A. 1 - A: A. 0 > ~ ) #L; #O; #P;`
  31.  
  32. &O
  33. 40 100 Ω
  34. "RA™"
  35. 60 45 Ω 
  36. "© 1986 COM~LINK & S.Koren" 
  37. 80 60 Ω
  38. "All rights reserved." `
  39.  
  40. &L
  41. 35 A: ("•" A. 1 - A: A. 0 > ~ ) "!"`
  42.  
  43. &N
  44. "•" 33 A: (" " A. 1 - A: A. 0 > ~ ) "•" "!"`
  45.  
  46. &P ?§ @ `
  47. $